import request from '@/utils/request.ts'

export function login(data) {
  return request({
    url: '/api/account/login/',
    method: 'post',
    data
  })
}

export function getInfo({ name = '', id = '' }) {
  return request({
    url: '/api/account/queryUserInfo/?name=' + name + '&id=' + id,
    method: 'get'
  })
}

export function updateUserInfo(data) {
  return request({
    url: '/api/account/update/',
    method: 'post',
    data
  })
}

export function addUser(data) {
  return request({
    url: '/api/account/add/',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/api/account/delete/',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/api/account/logout/',
    method: 'post'
  })
}

export function refreshToken() {
  return request({
    url: '/api/account/refresh/',
    method: 'get'
  })
}

